﻿
//控件集合
var c;
//当前窗口
var Shadowbox = window.parent.Shadowbox;
//页面加载完成,初始化控件集合
$(document).ready(function () {

    var collection = [
                New(ASPxRFTextBox, ['txtUsername', ['GroupA'], 'Username']),
                New(ASPxRFTextBox, ['txtEmail', ['GroupA'], 'Email']),
                New(ASPxRFTextBox, ['txtMobilePhone', ['GroupA'], 'MobilePhone'])
            ];

    c = New(RapidForm, [collection]);
});

//批量更新
var doSubmittedToBulkEdit = function () {
    //编辑列信息
    var columnSettings = c.getQueryString('GroupA');
    //Keyid集合
    var keyids = parent.gvwList.GetSelectedKeysOnPage().join('_');
    //调用批量编辑
    var BulkEditUsers = SGDemo.Permission.BulkEditUsers;
    BulkEditUsers.BulkEdit(columnSettings, keyids, function (ret) {
        //批量更新后GridView刷新
        if (ret.value) {
            //关闭当前窗口
            doClose();
            top.alertMsg.correct('批量编辑成功！')
            parent.gvwList.PerformCallback();
        } else {
            top.alertMsg.correct('批量编辑失败！')
        }
    });
};

//重置控件
var doResetToBulkEdit = function () {
    c.reset('GroupA');
}

//关闭当前窗口
var doClose = function () {
    Shadowbox.close();
}
